import * as fetch from 'common/fetch.js';
var bookClassify = require('./bookClassify.json');

//获取书籍分类
export function bookClassify(){
	return bookClassify;
}

//获取分类下书籍列表
export function bookClassifyList({ classifyName, pageNo }){
	return fetch.get("/o2o/api/bookClassifyList?classifyName="+classifyName+"&pageNo="+pageNo);
}

//获取书籍详情
export function bookDetail({ id }){
	return fetch.get("/o2o/api/bookDetail?id="+id);
}

//获取书籍评论
export function bookComments({ id }){
	return fetch.get("/o2o/api/bookComments?id="+id);
}

//搜索字段提示
export function bookSearchAutoComplete({ keywords }){
	return fetch.get("/o2o/api/bookSearchAutoComplete?keywords="+keywords);
}

//搜索内容
export function bookSearch({ keywords }){
	return fetch.get("/o2o/api/bookSearch?keywords="+keywords);
}

//书籍目录
export function bookChapterList({ id }){
	return fetch.get("/o2o/api/bookChapterList?id="+id);
}

//书籍章节内容
export function bookChapterContent({ link }){
	return fetch.get("/o2o/api/bookChapterContent?link="+link);
}
